//ehWhatIs v0.1
//Adds a /whatis command to display Minecraft's Item IDs
//so lazy dummies can find out what's in their bucket

import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class ehWhatIs extends Plugin {

    public void addCustomCommands() {
        etc.getInstance().addCommand("/whatis", " use /whatis <ITEM ID#>");
    }

    public void removeCustomCommands() {
        etc.getInstance().removeCommand("/whatis");
    }

    public String getItemName(int i)    {
        switch (i) {
            case 1:
                return "smooth stone";
            case 2:
                return "grass";
            case 3:
                return "dirt";
            case 4:
                return "cobblestone";
            case 5:
                return "wood planks";
            case 6:
                return "sapling";
            case 7:
                return "bedrock";
            case 8:
                return "water spring";
            case 9:
                return "water spring";
            case 10:
                return "lava spring";
            case 11:
                return "lava spring";
            case 12:
                return "sand";
            case 13:
                return "gravel";
            case 14:
                return "gold ore";
            case 15:
                return "iron ore";
            case 16:
                return "coal block";
            case 17:
                return "log";
            case 18:
                return "leaves";
            case 19:
                return "sponge";
            case 20:
                return "glass";
            case 35:
                return "wool";
            case 37:
                return "yellow flower";
            case 38:
                return "red flower";
            case 39:
                return "brown mushroom";
            case 40:
                return "red mushroom";
            case 41:
                return "gold block";
            case 42:
                return "iron block";
            case 43:
                return "double halfblock";
            case 44:
                return "half block";
            case 45:
                return "brick block";
            case 46:
                return "TNT";
            case 47:
                return "bookcase";
            case 48:
                return "mossy cobblestone";
            case 49:
                return "obsidian";
            case 50:
                return "torch";
            case 51:
                return "fire";
            case 52:
                return "spawner";
            case 53:
                return "wood stairs";
            case 54:
                return "chest";
            case 55:
                return "redstone powder";
            case 56:
                return "diamond ore";
            case 57:
                return "diamond block";
            case 58:
                return "crafting table";
            case 59:
                return "planted seeds";
            case 60:
                return "tilled dirt";
            case 61:
                return "furnace";
            case 62:
                return "furnace";
            case 65:
                return "ladder";
            case 66:
                return "rail";
            case 67:
                return "stone stairs";
            case 69:
                return "switch";
            case 70:
                return "stone plate";
            case 72:
                return "wooden plate";
            case 73:
                return "redstone ore";
            case 74:
                return "redstone ore";
            case 75:
                return "unlit redstone torch";
            case 76:
                return "redstone torch";
            case 77:
                return "button";
            case 78:
                return "snow covering";
            case 79:
                return "ice block";
            case 80:
                return "snow block";
            case 81:
                return "cactus";
            case 82:
                return "clay block";
            case 83:
                return "reeds";
            case 84:
                return "music box";
            case 85:
                return "fence";
            case 256:
                return "iron shovel";
            case 257:
                return "iron pickaxe";
            case 258:
                return "iron axe";
            case 259:
                return "lighter";
            case 260:
                return "apple";
            case 261:
                return "bow";
            case 262:
                return "arrow";
            case 263:
                return "coal";
            case 264:
                return "diamond";
            case 265:
                return "iron";
            case 266:
                return "gold";
            case 267:
                return "iron sword";
            case 268:
                return "wooden sword";
            case 269:
                return "wooden shovel";
            case 270:
                return "wooden pickaxe";
            case 271:
                return "wooden axe";
            case 272:
                return "stone sword";
            case 273:
                return "stone shovel";
            case 274:
                return "stone pickaxe";
            case 275:
                return "stone axe";
            case 276:
                return "diamond sword";
            case 277:
                return "diamond shovel";
            case 278:
                return "diamond pickaxe";
            case 279:
                return "diamond axe";
            case 280:
                return "stick";
            case 281:
                return "bowl";
            case 282:
                return "mushroom soup";
            case 283:
                return "gold sword";
            case 284:
                return "gold shovel";
            case 285:
                return "gold pickaxe";
            case 286:
                return "gold axe";
            case 287:
                return "string";
            case 288:
                return "feather";
            case 289:
                return "gunpowder";
            case 290:
                return "wooden hoe";
            case 291:
                return "stone hoe";
            case 292:
                return "iron hoe";
            case 293:
                return "diamond hoe";
            case 294:
                return "gold hoe";
            case 295:
                return "seeds";
            case 296:
                return "wheat";
            case 297:
                return "bread";
            case 298:
                return "leather helm";
            case 299:
                return "leather chest";
            case 300:
                return "leather pants";
            case 301:
                return "leather shoes";
            case 306:
                return "iron helm";
            case 307:
                return "iron chest";
            case 308:
                return "iron pants";
            case 309:
                return "iron shoes";
            case 310:
                return "diamond helm";
            case 311:
                return "diamond chest";
            case 312:
                return "diamond pants";
            case 313:
                return "diamond shoes";
            case 314:
                return "gold helm";
            case 315:
                return "gold chest";
            case 316:
                return "gold pants";
            case 317:
                return "gold shoes";
            case 318:
                return "flint";
            case 319:
                return "uncooked meat";
            case 320:
                return "cooked meat";
            case 321:
                return "painting";
            case 322:
                return "golden apple";
            case 323:
                return "sign";
            case 324:
                return "wooden door";
            case 325:
                return "bucket";
            case 326:
                return "water bucket";
            case 327:
                return "lava bucket";
            case 328:
                return "minecart";
            case 329:
                return "saddle";
            case 330:
                return "iron door";
            case 331:
                return "redstone powder";
            case 332:
                return "snowball";
            case 333:
                return "boat";
            case 334:
                return "leather";
            case 335:
                return "milk bucket";
            case 336:
                return "clay block";
            case 337:
                return "clay ball";
            case 338:
                return "reeds";
            case 339:
                return "paper";
            case 340:
                return "book";
            case 341:
                return "slimeball";
            case 342:
                return "chestcart";
            case 343:
                return "funacecart";
            case 344:
                return "egg";
            case 345:
                return "compass";
            case 2256:
                return "yellow record";
            case 2257:
                return "green record";
            default:
                return "notfound";
        }
    } 

    

     private String getDateTime() {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = new Date();
        return dateFormat.format(date);
    }

    public void enable() {
        System.out.println(getDateTime()+" [INFO] ehWhatIs enabled");
        etc.getInstance().addCommand("/whatis", " use /whatis <ITEM ID#)");
    }

    public void disable() {
        System.out.println(getDateTime()+" [INFO] ehWhatIs disabled");
        etc.getInstance().removeCommand("/whatis");
    }
}